﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using DataAccess;

namespace DataService
{
    class UsersService:ServiceBase<aspnet_User>
    {
        public UsersService(string connectionString) : base(connectionString)
        {
        }

        public aspnet_User GetUserByName(string name)
        {
            using (var dataContext = new DataContext(base._connectionString))
            {
                var table = dataContext.GetTable<aspnet_User>();
                return table.Where(item => item.UserName == name).First();
            }
        }

        #region Overrides of ServiceBase<aspnet_User>

        protected override aspnet_User GetRecord(int itemID, DataContext dataContext)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
